package com.healthy.service;

import com.healthy.entity.Customerprofile;
import com.healthy.entity.Returnvisit;
import com.healthy.mapper.CustomerprofileMapper;
import com.healthy.mapper.ReturnvisitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ReturnvisitService {

    @Autowired
    ReturnvisitMapper returnvisitMapper;

    //    查询全部
    public List<Returnvisit> cuList() {
        return returnvisitMapper.culist();
    }

    //    添加
    public Returnvisit cuInsert(Returnvisit returnvisit) {

        returnvisitMapper.cuInsert(returnvisit);
        return returnvisit;
    }

    //    删除
    public int cuDeleteByid(int id) throws Exception {
        int res = returnvisitMapper.cuDeleteByid(id);
        if (res > 0) {
            return 1;
        } else {
            return 0;
        }
    }
    //    修改
    public int cuUpdateByid(int id,String name,String type,String content,String doctor) throws Exception {
        int res = returnvisitMapper.cuUpdateByid(id,name,type,content,doctor);
        if (res > 0) {
            return 1;
        } else {
            return 0;
        }
    }
}
